package i_iterator.a_design_pattern;

/**
 * Created by wug on 2016/7/13 0013.
 */
public class MyMapIterator<E> implements MyIterator {
    private String[] keys;
    private E[] values;
    private int index = 0;

    public MyMapIterator(String[] keys, E[] values) {
        this.keys = keys;
        this.values = values;
    }

    @Override
    public boolean hasNext() {
        if (null != keys[index]) {
            return true;
        }
        return false;
    }

    @Override
    public E next() {
        index++;
        return values[index-1];
    }
}
